<template>
  <el-form :model="queryParams" ref="queryRef" :inline="true">
    <el-form-item label="公告标题" prop="noticeTitle">
      <el-input
        v-model="queryParams.noticeTitle"
        placeholder="请输入公告标题"
        clearable
        style="width: 200px"
        @keyup.enter="handleQuery"
      />
    </el-form-item>
    <el-form-item label="操作人员" prop="createBy">
      <el-input
        v-model="queryParams.createBy"
        placeholder="请输入操作人员"
        clearable
        style="width: 200px"
        @keyup.enter="handleQuery"
      />
    </el-form-item>
    <el-form-item label="类型" prop="noticeType">
      <el-select v-model="queryParams.noticeType" placeholder="公告类型" clearable style="width: 200px">
        <el-option
          v-for="dict in sys_notice_type"
          :key="dict.value"
          :label="dict.label"
          :value="dict.value"
        />
      </el-select>
    </el-form-item>
    <el-form-item>
      <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
      <el-button icon="Refresh" @click="resetQuery">重置</el-button>
    </el-form-item>
  </el-form>
</template>

<script setup>
defineProps({
  queryParams: {
    type: Object,
    required: true
  },
  sys_notice_type: {
    type: Array,
    required: true
  }
})

const emit = defineEmits(['query', 'reset'])

function handleQuery() {
  emit('query')
}

function resetQuery() {
  emit('reset')
}
</script>
